#!/usr/bin/node
const Dog=require('./05-dog.js');
let taidi=new Dog('taidi',4),
    zanao=new Dog('zangao',8);

taidi.on('bark',onBark.bind(taidi));
zanao.on('bark',onBark.bind(zanao));

function onBark(){
  console.log(`${this.name} barked! energy:${this.energy}`);
}
